function js_date_time(unixtime) {
  var dateTime = new Date(parseInt(unixtime) * 1000)
  var year = dateTime.getFullYear();
<<<<<<< HEAD
  var month = zeroFill(dateTime.getMonth() + 1);
  var day = zeroFill(dateTime.getDate());
=======
  var month = dateTime.getMonth() + 1;
  var day = dateTime.getDate();
>>>>>>> 1c9ce1fdc7fcbf1a028b999eb3cd07f698a8a329
  var hour = dateTime.getHours();
  var minute = dateTime.getMinutes();
  var second = dateTime.getSeconds();
  var now = new Date();
  var now_new = Date.parse(now.toDateString()); //typescript转换写法
  var milliseconds = now_new - dateTime;
  var timeSpanStr = year + '-' + month + '-' + day ;
  return timeSpanStr;
 }
<<<<<<< HEAD
 function zeroFill(str, n=2){
  //补零方法，str为数字字符串 n为需要的位数，不够补零
  if ( str.toString().length < n){
   str = '0'+str.toString()
  }
  return str
 }
=======
>>>>>>> 1c9ce1fdc7fcbf1a028b999eb3cd07f698a8a329
 module.exports = {
  js_date_time: js_date_time
 }